import Cookies from 'js-cookie'
import request from './request'

// const TokenKey = 'Admin-Token'
const TokenKey = 'access_token'


export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function setUserId(userId) {
  return Cookies.set("user_id", userId)
}

export function setUsername(username) {
  return Cookies.set("username", username)
}

export function getUsername() {
  return Cookies.get("username")
}

export function getUserId() {
  return Cookies.get("user_id")
}
